Ext.define('truckplanner.view.mission.Edit', {
	extend: 'Ext.form.Panel',

	alias : 'widget.missioneditor',
	
	width : 800,
	height : 450,
	bodyStyle : 'padding:5px 5px 0',
	
	// The fields
    defaultType: 'textfield',
    items : [           
        {
        xtype: 'datefield',
        disabled: true,
        anchor: '30%',
        fieldLabel: 'To',
        name: 'Date',
        id: 'Date',
        format: 'd/m/Y',
        value: new Date()  // defaults to today
    },{
        xtype: 'timefield',
        disabled:true,
        name: 'StartTime',
        id: 'StartTime',
        fieldLabel: 'Début',
        minValue: '4:00',
        maxValue: '22:00',
        value: '8:00',
        increment: 30,
        anchor: '30%',
        format: 'H:i'
    },{
        fieldLabel: 'De',
        name: 'StartLocation',
        id : 'StartLocation',
        disabled:true,
        allowBlank: false,
        anchor: '50%',
    	xtype: 'combobox',
        store: 'Yards',
        triggerAction: 'all',
        displayField:'name',
        forceSelection: true
    },{
        fieldLabel: 'A',
        disabled:true,
        name: 'EndLocation',
        id: 'EndLocation',
        allowBlank: false,
        anchor: '50%',
        xtype: 'combobox',
        store: 'Yards',
        triggerAction: 'all',
        displayField:'name',
        forceSelection: true
    },{
        xtype: 'timefield',
        disabled:true,
        name      : 'TravelTime',
        id      : 'TravelTime',
        fieldLabel: 'Durée du trajet',
        minValue: '0:00',
        value: '1:00',
        increment: 30,
        anchor: '30%',
        format: 'H:i'
    },{
    	xtype : 'combobox',
        fieldLabel: 'Matétiel',
        name: 'Hardware',
        id : 'Hardware',
        displayField: 'displayFieldName',
        valueField: 'dataFieldName',
        store : new Ext.data.SimpleStore({
			        fields: ['dataFieldName', 'displayFieldName'],
			        data: [['C', 'Camion'], ['CR', 'Camion & Remorque'], 
			            ['CA', 'Camionette']],
			        autoLoad: false
			    }),
		value : 'C',
        disabled:true,
        allowBlank: false,
        anchor: '50%'
    },{
        xtype     : 'textareafield',
        disabled:true,
        grow      : true,
        name      : 'Work',
        id      : 'Work',
        fieldLabel: 'Travail à réaliser',
        anchor    : '80%'
    },{
        xtype: 'timefield',
        disabled:true,
        name      : 'WorkTime',
        id      : 'WorkTime',
        fieldLabel: 'Durée du travail',
        minValue: '0:00',
        value: '1:00',
        increment: 30,
        anchor: '30%',
        format: 'H:i'
    }],
    
    buttons: [ {
        text: 'Nouveau',
        action: 'new'
    },{
        text: 'Sauver',
        disabled:true,
        action: 'save'
    },{
        text: 'Annuler',
        disabled:true,
        action: 'cancel'
    }]
});